a11y: Add method to extract desktop data
authorEmmanuele Bassi <ebassi@gnome.org>
Fri, 9 Oct 2020 21:38:08 +0000 (22:38 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Mon, 12 Oct 2020 15:19:32 +0000 (16:19 +0100)
We are going to need the desktop name and path to populate the parent
property of AtSpiContexts associated to top level widgets.

gtk/a11y/gtkatspiroot.c
gtk/a11y/gtkatspirootprivate.h

index acc98f12a2f4ee5e6710ec53dbd2dacd148933bb..d27d979f352b37dbd16489e1775460cc981dc71b 100644 (file)
@@ -209,8 +209,7 @@ handle_accessible_method (GDBusConnection       *connection,
                           GDBusMethodInvocation *invocation,
                           gpointer               user_data)
 {
-  g_printerr ("[Accessible] Method '%s' on interface '%s' for object '%s' from '%s'\n",
-              method_name, interface_name, object_path, sender);
+  GtkAtSpiRoot *self = user_data;
 
   if (g_strcmp0 (method_name, "GetRole") == 0)
     g_dbus_method_invocation_return_value (invocation, g_variant_new ("(u)", ATSPI_ROLE_APPLICATION));
@@ -455,3 +454,16 @@ gtk_at_spi_root_get_cache (GtkAtSpiRoot *self)
 
   return self->cache;
 }
+
+void
+gtk_at_spi_root_get_application (GtkAtSpiRoot *self,
+                                 const char **name,
+                                 const char **path)
+{
+  g_return_if_fail (GTK_IS_AT_SPI_ROOT (self));
+
+  if (name != NULL)
+    *name = self->desktop_name;
+  if (path != NULL)
+    *path = self->desktop_path;
+}
index 4e951bbcea87f0bb57703290c641315333d7d050..268c8a161fb4a144e55bfa9c0c95efefeeca5808 100644 (file)
@@ -39,4 +39,9 @@ gtk_at_spi_root_get_connection (GtkAtSpiRoot *self);
 GtkAtSpiCache *
 gtk_at_spi_root_get_cache (GtkAtSpiRoot *self);
 
+void
+gtk_at_spi_root_get_application (GtkAtSpiRoot *self,
+                                 const char **name,
+                                 const char **path);
+
 G_END_DECLS